package com.example.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.domain.Setmeal;
import com.example.dto.SetmealDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {
    @Select("SELECT setmeal.id,setmeal.category_id,setmeal.name,setmeal.price,setmeal.status,setmeal.code," +
            "setmeal.description,setmeal.image,setmeal.is_deleted,\n" +
            " setmeal.create_time,setmeal.update_time,setmeal.create_user,setmeal.update_user,\n" +
            " category.name AS categoryName\n" +
            " FROM setmeal,category " +
            "WHERE setmeal.category_id=category.id")
    IPage<SetmealDto> getSetmealDtoPage(IPage<SetmealDto> iPage, LambdaQueryWrapper<Setmeal> queryWrapper);
}
